﻿using LimaLims.Application.Service.Base.Dto;
using LimaLims.Core;
using LimaLims.Core.Enum;
using LimaLims.Core.Util;

namespace LimaLims.Application.Service.TestCenter.Dto
{
    /// <summary>
    /// 色谱试验
    /// </summary>
    public class ChromTestOutput : BaseDto
    {
        /// <summary>
        /// 设备Id
        /// </summary>
        public long EquipmentInfoId { get; set; }
        /// <summary>
        /// 设备编号
        /// </summary>
        public string EquipmentCode { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string EquipmentName { get; set; }

        /// <summary>
        /// 试验任务ID
        /// </summary>
        public long? ExperimentTaskId { get; set; }

        /// <summary>
        /// 试验任务编号
        /// </summary>
        public string ExperimentTaskCode { get; set; }
        /// <summary>
        /// 环境温度
        /// </summary>
        public float? AmbientTemperature { get; set; }

        /// <summary>
        /// 环境湿度
        /// </summary>
        public float? AmbientHumidity { get; set; }

        /// <summary>
        /// 氢气
        /// </summary>
        public float? H2 { get; set; }

        /// <summary>
        /// 一氧化碳
        /// </summary>
        public float? CO { get; set; }

        /// <summary>
        /// 二氧化碳
        /// </summary>
        public float? CO2 { get; set; }

        /// <summary>
        /// 甲烷
        /// </summary>
        public float? CH4 { get; set; }

        /// <summary>
        /// 乙烯
        /// </summary>
        public float? C2H4 { get; set; }

        /// <summary>
        /// 乙烷
        /// </summary>
        public float? C2H6 { get; set; }

        /// <summary>
        /// 乙炔
        /// </summary>
        public float? C2H2 { get; set; }

        /// <summary>
        /// 氧
        /// </summary>
        public float? O2 { get; set; }

        /// <summary>
        /// 氮
        /// </summary>
        public float? N2 { get; set; }

        /// <summary>
        /// 总烃
        /// </summary>
        public float? Voc { get; set; }

        /// <summary>
        /// 色谱机试验结果备注
        /// </summary>
        public string Memo { get; set; }

        /// <summary>
        /// 色谱机试验诊断结果
        /// </summary>
        public string DiagnoseResult { get; set; }

        /// <summary>
        /// 试验结果
        /// </summary>
        public ExperimentResult? Result { get; set; }

        /// <summary>
        /// 取样日期
        /// </summary>
        public DateTime SamplingDate { get; set; }

        /// <summary>
        /// 测试日期
        /// </summary>
        public DateTime TestDate { get; set; }

        /// <summary>
        /// 试验结果Text
        /// </summary>
        public string ResultText => Result.HasValue ? Result.GetDescription() : "";
    }

    /// <summary>
    /// 色谱试验分页查询
    /// </summary>
    public class ChromTestPageInput : PageInputBase
    {
        /// <summary>
        /// 任务编号
        /// </summary>
        public string ExperimentTaskCode { get; set; }

        /// <summary>
        /// 设备编号
        /// </summary>
        public string EquipmentCode { get; set; }
    }
}
